
#include "Fifo.hpp"
#include "Shm.hpp"

int main()
{
    FileOper writerfile(PATH, FILENAME);
    writerfile.OpenForWrite();
    Shm shm(gpathname, gprojid, USER);
    char *mem = (char*)shm.VirtualAddr();

    int index = 0;
    for(char c = 'A'; c <= 'B'; c++, index += 2)
    {   
        sleep(1);
        mem[index] = c;
        mem[index + 1] = c;
        mem[index + 2] = '\0';
        std::cout<<"write "<<c<<" to shm"<<std::endl;
        writerfile.Wakeup();
    }
    writerfile.Close();

    return 0;
}